package com.uusee.crawler.pageprocessor.video.ku6;

import java.util.Date;

import com.uusee.crawler.util.PageProcessorUtils;
import com.uusee.shipshape.gt.model.UploadUser;

public class Ku6UploadUserBlogPageProcessor {
	private static final String UPLOAD_USER_ID_REG = "var\\sOwnerInfo\\s=\\s{\\sid:\\s\"([0-9]+)\",";
	
	public void process(String url,String pageHtml,UploadUser uploadUser) {
		try {
			String userBlogUrl = url;
			String userId =  PageProcessorUtils.getValue(UPLOAD_USER_ID_REG, pageHtml);
			//String username = AnalyzerUtils.getValue(regex, pageHtml);
			//String logo = AnalyzerUtils.getValue(regex, pageHtml);
					
			uploadUser.setSourceSite("www.ku6.com");
			uploadUser.setUserId(userId);
			//uploadUser.setUsername(username);
			uploadUser.setUserBlogUrl(userBlogUrl);
			//uploadUser.setLogo(logo);
			uploadUser.setUpdateUser("crawler");
			uploadUser.setUpdateDate(new Date());

		} catch (Exception e) {
			throw new RuntimeException("失败。");
		}
	}
}
